package nancal.mp.db.mongo.table

import java.io.*
import nbcp.base.db.*
import nbcp.base.comm.*
import nbcp.base.extend.*
import nbcp.base.enums.*
import nbcp.base.utils.*
import nbcp.myoql.db.*
import nbcp.myoql.db.comm.*
import nbcp.myoql.db.enums.*
import nbcp.myoql.db.mongo.*
import nbcp.myoql.db.mongo.base.*
import nbcp.myoql.db.mongo.component.*
import org.slf4j.LoggerFactory
import org.springframework.stereotype.*



class ApiBodyParameterDefineMeta(private val parentPropertyName: String): MongoColumnName() {
    constructor(value: MongoColumnName) : this(value.toString()) {}
    /**
     * 数据类型是对象或数组时，子级的类型定义
     */
    @nbcp.base.db.annotation.Cn(value = """数据类型是对象或数组时，子级的类型定义""")
    val items = mongoColumnJoin(this.parentPropertyName, "items") /*:递归类*/
    /**
     * 属性名
     */
    @nbcp.base.db.annotation.Cn(value = """属性名""")
    val key = mongoColumnJoin(this.parentPropertyName, "key")
    val type = mongoColumnJoin(this.parentPropertyName, "type")
    val isList = mongoColumnJoin(this.parentPropertyName, "isList")
    /**
     * 可选数据,当 type 是 Radio,Check, 或者 arrayItemType 是Radio,Check 时
     */
    @nbcp.base.db.annotation.Cn(value = """可选数据,当 type 是 Radio,Check, 或者 arrayItemType 是Radio,Check 时""")
    val enumData = mongoColumnJoin(this.parentPropertyName, "enumData")
    val enumType = mongoColumnJoin(this.parentPropertyName, "enumType")
    /**
     * type=object/enum时,引入的类型,apiModel
     */
    @nbcp.base.db.annotation.Cn(value = """type=object/enum时,引入的类型,apiModel""")
    val referenceModelName = mongoColumnJoin(this.parentPropertyName, "referenceModelName")
    /**
     * 默认值
     */
    @nbcp.base.db.annotation.Cn(value = """默认值""")
    val defaultValue = mongoColumnJoin(this.parentPropertyName, "defaultValue")
    /**
     * 必填
     */
    @nbcp.base.db.annotation.Cn(value = """必填""")
    val required = mongoColumnJoin(this.parentPropertyName, "required")
    /**
     * 备注
     */
    @nbcp.base.db.annotation.Cn(value = """备注""")
    val remark = mongoColumnJoin(this.parentPropertyName, "remark")
    override fun toString(): String {
        return mongoColumnJoin(this.parentPropertyName).toString()
    }
}

